import "@babel/polyfill";
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./plugins/element.js";
import VueQuillEditor from "vue-quill-editor";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
import uploader from 'vue-simple-uploader'
import VueVideoPlayer from 'vue-video-player'
import 'video.js/dist/video-js.css'
import hls from 'videojs-contrib-hls'
Vue.use(hls)
Vue.use(VueVideoPlayer)
// import myeialog from '@/components/myeialog'
Vue.use(VueQuillEditor);
Vue.use(uploader);
// Vue.use(myeialog);
// import recharge from "./components/materials/check";
// import supInfo from "./views/supplier/check";

Vue.config.productionTip = false;
Vue.use(store);
// Vue.use(recharge);
// Vue.use(supInfo);
router.beforeEach((to, from, next) => {
  //NProgress.start();
  if (to.path == "/") {
    sessionStorage.removeItem("user");
  }
  let user = JSON.parse(sessionStorage.getItem("user"));
  if (!user && to.path != "/") {
    next({ path: "/" });
  } else {
    next();
  }
});
Vue.prototype.$baseUrl = "https://yjh.tianyibim.com"; //线上
//Vue.prototype.$baseUrl = "http://yjh.com"; //验证码 1 线下
//Vue.prototype.$baseUrl = "https://testyjh.tianyibim.com"; //验证码 1 测试的

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
